<template>
	<view>
		<view class="mainpadding" style="background-color: #ff5555;" v-if="!is_login" @click="jumpurl('/pages/login/login')">
			<view class="flexcolumn">
				<image :src="emptyAvatar" class="headimg" mode=""></image>
				<view class="sanshier xiaobai bold margin_top">{{$t("my.djdl")}}</view>
			</view>
		</view>
		<view class="mainpadding" style="background-color: #ff5555;position: relative;padding-bottom: 80rpx;border-radius: 0 0 40rpx 40rpx;" v-if="is_login" >
			<view class="flexcolumn">
				<image :src="userinfo.avatarUrl?userinfo.avatarUrl:emptyAvatar" class="headimg" mode=""></image>
				<view class="sanshier xiaobai bold margin_top">{{userinfo.nickName}}</view>
			</view>
			<view class="flexcolumn yuebox xiaobai ershiba">
				<text>{{$t('my.ye')}}</text>
				<text class="margin_top1">10550</text>
			</view>
		</view>
		<view class="mainpadding ffffff">
			<view class="flexbetween">
				<view class="titletext xiaohei bold">{{$t("my.wddd")}}</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="flexaround margin_top6">
				<view class="flexcolumn">
					<image src="@/static/image/system/my1.png" class="myimg" mode=""></image>
					<view class="strongtext margin_top1 xiaohui">{{$t("my.dfw")}}</view>
				</view>
				<view class="flexcolumn">
					<image src="@/static/image/system/my2.png" class="myimg" mode=""></image>
					<view class="strongtext margin_top1 xiaohui">{{$t("my.dfh")}}</view>
				</view>
				<view class="flexcolumn">
					<image src="@/static/image/system/my3.png" class="myimg" mode=""></image>
					<view class="strongtext margin_top1 xiaohui">{{$t("my.dsh")}}</view>
				</view>
				<view class="flexcolumn">
					<image src="@/static/image/system/my4.png" class="myimg" mode=""></image>
					<view class="strongtext margin_top1 xiaohui">{{$t("my.dpj")}}</view>
				</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff">
			<view class="xiahuaxian flexbetween">
				<view class="flexleft">
					<image src="@/static/image/system/my5.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.yhq")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="xiahuaxian flexbetween margin_top" @click="jumpurl('/pages/mypage/shangpinsc')">
				<view class="flexleft">
					<image src="@/static/image/system/my6.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.spsc")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="flexbetween margin_top" @click="jumpurl('/pages/mypage/wodezj')">
				<view class="flexleft">
					<image src="@/static/image/system/my7.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.llzj")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
		</view>
		<view class="mainpadding_top ffffff">
			<view class="xiahuaxian flexbetween" @click="jumpurl('/pages/mypage/dizhigl')">
				<view class="flexleft">
					<image src="@/static/image/system/my11.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.dzgl")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="xiahuaxian flexbetween margin_top">
				<view class="flexleft">
					<image src="@/static/image/system/my12.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.bdsj")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="xiahuaxian flexbetween margin_top" @click="jumpurl('/pages/mypage/yijianfk')">
				<view class="flexleft">
					<image src="@/static/image/system/my13.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.yjfk")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="xiahuaxian flexbetween margin_top">
				<view class="flexleft">
					<image src="@/static/image/system/my14.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.lxkf")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
			<view class="flexbetween margin_top" @click="jumpurl('/pages/mypage/guanyuwm')">
				<view class="flexleft">
					<image src="@/static/image/system/my15.png" class="myimg1 margin_right2" mode=""></image>
					<view class="ershiba xiaohei">{{$t("my.gywm")}}</view>
				</view>
				<u-icon name="arrow-right" color="#999" size="20"></u-icon>
			</view>
		</view>
		<!-- <view class="mainpadding" style="background-color: #f4f4f4;">
			<view class="titletext xiaohei bold">{{$t("my.hxfw")}}</view>
		</view> -->
		<!-- <view class="flexbetween mainpadding ffffff">
			<view class="flexcolumn">
				<image src="@/static/image/system/my5.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.yhq")}}</view>
			</view>
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/shangpinsc')">
				<image src="@/static/image/system/my6.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.spsc")}}</view>
			</view>
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/wodezj')">
				<image src="@/static/image/system/my7.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.llzj")}}</view>
			</view>
			<view class="flexcolumn">
				<image src="@/static/image/system/my8.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.wdpt")}}</view>
			</view>
			<view class="flexcolumn">
				<image src="@/static/image/system/my9.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.sh")}}</view>
			</view>
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/qianbao')">
				<image src="@/static/image/system/my10.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.qb")}}</view>
			</view>
		</view> -->
		<!-- <view class="mainpadding" style="background-color: #f4f4f4;">
			<view class="titletext xiaohei bold">{{$t("my.bbgj")}}</view>
		</view> -->
		<!-- <view class="flexbetween mainpadding ffffff">
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/dizhigl')">
				<image src="@/static/image/system/my11.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.dzgl")}}</view>
			</view>
			<view class="flexcolumn">
				<image src="@/static/image/system/my12.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.bdsj")}}</view>
			</view>
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/yijianfk')">
				<image src="@/static/image/system/my13.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.yjfk")}}</view>
			</view>
			<view class="flexcolumn">
				<image src="@/static/image/system/my14.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.lxkf")}}</view>
			</view>
			<view class="flexcolumn" @click="jumpurl('/pages/mypage/guanyuwm')">
				<image src="@/static/image/system/my15.png" class="myimg" mode=""></image>
				<view class="strongtext margin_top1 xiaohui">{{$t("my.gywm")}}</view>
			</view>
		</view> -->
		<view class="flexcenter sanshier xiaohong mainpadding_top ffffff" v-if="is_login" @click="outlogin">
			{{$t("my.tcdl")}}
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				userinfo:{},
				is_login:false
			}
		},
		onShow() {
			this.is_login = httpRequest.checkIsLogin();
			if (this.is_login) {
				this.userinfo = uni.getStorageSync('userinfo')
			}else{
				this.userInfo = null
			}
		},
		methods: {
			outlogin(){
				uni.clearStorageSync()
				this.userinfo = {}
				this.is_login = false
			},
			jumpurl(url){
				if(!this.is_login){
					uni.navigateTo({
						url:"/pages/login/login"
					})
					return false
				}
				uni.navigateTo({
					url
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.headimg{
	width: 140rpx;
	height: 140rpx;
	border-radius: 50%;
}
.myimg{
	width: 60rpx;
	height: 60rpx;
}
.yuebox{
	position: absolute;
	top: 80rpx;
	right: 60rpx;
}
.myimg1{
	width: 40rpx;
	height: 40rpx;
}
</style>
